<template>
  <el-row justify="space-around" style="margin-top: 30px">
    <FaultCount title="今日访问次数" :num="todaySum" />
    <FaultCount title="累积访问次数" :num="accumulateSum" />
  </el-row>
</template>
<script setup>
import FaultCount from '../../components/faultCount.vue'
import { getVisitNumByPro } from '@/api/activeFault'

const route = useRoute()
const { provinceName } = route.query

const todaySum = ref(0)
const accumulateSum = ref(0)
const visitiNum = () => {
  getVisitNumByPro(provinceName).then(res => {
    todaySum.value = res.data?.todayVisitNum || 0
    accumulateSum.value = res.data?.accumulateVisitNum || 0
  })
}

onMounted(() => {
  visitiNum()
})
</script>